package com.jinxin.platform.cdsideparkmgr.bean.enums;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-03-03
 * @Author: Lingnan
 **/

/**
 * 结果类型定义
 */
public enum ResultType {
    CODE_0(0,"设备状态"),
    CODE_128(128,"停车事件: 预入场"),
    CODE_1(1,"停车事件: 入场"),
    CODE_2(2,"停车事件：停稳"),
    CODE_256(256,"停车事件：预出场"),
    CODE_4(4,"停车事件：出场"),
    CODE_8(8,"停车事件：空场"),
    CODE_512(512,"停车事件：入场修正"),
    CODE_1024(1024,"停车事件：过道抓拍出场"),
    CODE_10(10,"订单"),
    CODE_11(11,"过道抓拍出场订单"),
    CODE_12(12,"手动抓拍"),
    CODE_13(13,"设备心跳"),
    CODE_16(16,"报警事件");

    private int code;
    private String desc;

    ResultType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    // 普通方法
    public static String getDesc(int code) {
        for (ResultType c : ResultType.values()) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
